//package com.trace.meat.config;
//
//
//import com.trace.meat.MeatApplication;
//import com.trace.meat.filter.RequestFilter;
//import org.springframework.boot.builder.SpringApplicationBuilder;
//import org.springframework.boot.web.servlet.FilterRegistrationBean;
//import org.springframework.boot.web.servlet.ServletComponentScan;
//import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import javax.servlet.Filter;
//
//
///**
// * Created by yanshao on 2018/12/26.
// */
//@Configuration
//@ServletComponentScan
//public class WebConfig extends SpringBootServletInitializer {
//
//    @Override
//    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
//        return application.sources(MeatApplication.class);
//    }
//
//    @Bean
//    public FilterRegistrationBean contextFilterRegistrationBean() {
//        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
//        registrationBean.setFilter(requestFilter());
//        registrationBean.addUrlPatterns("/*");
//        registrationBean.setName("requestFilter");
//        registrationBean.setOrder(1);
//        return registrationBean;
//    }
//
//    @Bean
//    public Filter requestFilter() {
//        return new RequestFilter();
//    }
//
//}
